package com.cn.zmc.design.chian.disruptor.handle;

import com.cn.zmc.design.chian.domain.Trade;
import com.lmax.disruptor.EventHandler;
import org.springframework.stereotype.Component;

import java.util.UUID;
@Component
public class HandlerTwoService implements EventHandler<Trade> {

	public void onEvent(Trade event, long sequence, boolean endOfBatch) throws Exception {
		System.err.println("handler 2 : SET ID");
		Thread.sleep(2000);
		event.setId(UUID.randomUUID().toString());
		System.err.println("handler 2 : end");
	}

}
